package com.example.kyyl.entity;

import android.bluetooth.BluetoothDevice;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * @ProjectName: KYYL
 * @Package: com.wehand.ble.adapter
 * @ClassName: BleBean
 * @Description: java类作用描述
 * @Author: 小星
 * @CreateDate: 2021/5/31 0031 12:52
 * @UpdateUser: 更新者：
 * @UpdateDate: 2021/5/31 0031 12:52
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
public class BleBean implements Parcelable {
    private BluetoothDevice mDevice;
    private String isConnect;

    public BleBean(BluetoothDevice bluetoothDevice, String isConnect) {
        this.mDevice = bluetoothDevice;
        this.isConnect = isConnect;
    }

    public BluetoothDevice getDevice() {
        return mDevice;
    }

    public void setDevice(BluetoothDevice device) {
        mDevice = device;
    }

    public String getIsConnect() {
        return isConnect == null ? "" : isConnect;
    }

    public void setIsConnect(String isConnect) {
        this.isConnect = isConnect == null ? "" : isConnect;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.mDevice, flags);
        dest.writeString(this.isConnect);
    }

    protected BleBean(Parcel in) {
        this.mDevice = in.readParcelable(BluetoothDevice.class.getClassLoader());
        this.isConnect = in.readString();
    }

    public static final Parcelable.Creator<BleBean> CREATOR = new Parcelable.Creator<BleBean>() {
        @Override
        public BleBean createFromParcel(Parcel source) {
            return new BleBean(source);
        }

        @Override
        public BleBean[] newArray(int size) {
            return new BleBean[size];
        }
    };
}
